import javax.swing.JOptionPane;

/**
 * The main class for the Sudoku game.
 * Responsible for having the player choose a type of User Interface.
 * @author Kat.Winter
 */
public class SudokuApp {
	
	/**
	 * Object for this Sudoku User Interface
	 */
	private static SudokuUI ui;
	
	/**
	 * Object for this game of Sudoku
	 */
	private static SudokuGame game;

	/**
	 * Gets player input for what kind of User Interface should be used
	 * and the level of difficulty to be played.
	 * Instantiates a UI based on player input, and sets up that UI as
	 * an Observer of the game.
	 * @param args
	 */
	public static void main(String[] args) {

		int size = 9;
		//final int gui = JOptionPane.YES_OPTION;	
		//Object[] uiOptions = {"GUI", "Console"};
		Object[] lvlOptions = {"Easy", "Medium", "Hard"};
		
		String lvlChoice = (String)JOptionPane.showInputDialog(null, "Please select a level of difficulty:", "Difficulty", JOptionPane.QUESTION_MESSAGE, null, lvlOptions, lvlOptions[0]);
		
		if (lvlChoice != null) {
			
			game = new SudokuGame(size, lvlChoice);
		}
		
		else {
			
			System.exit(0);
		}
		
		/*int uiChoice = JOptionPane.showOptionDialog(null, "Please choose a User Interface:", "User Interface", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, uiOptions, uiOptions[0]);
		
		if (uiChoice == gui) {
			
			ui = new SudGUI(game, size);
		}
		
		else {
			
			ui = new ConsoleUI(game, size);
		}*/
		
		ui = new SudGUI(game, size);	
			
		game.addObserver(ui);
			
		game.newGame();
		ui.startUI();
	}
}
